package com.sky.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author Administrator
 * @version 1.0
 * @description: TODO
 * @date 2023/9/25 9:01
 */
@Slf4j
//@Component
public class MyTask {
    @Scheduled(cron = "0/5 * * * * ?")
    public void print() {
        log.warn("每五秒一次的定时任务执行了...");
    }


    private Integer num = 10;

    @Scheduled(cron = "0/1 * * * * ?")
    public void print2() {
        if (num >= 0) {
            log.warn("火箭倒计时开始：" + num--);
        }
    }

}
